package com.blkbox.cxf.first.client;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPBinding;

import com.blkbox.cxf.first.server.IService;

public class JaxwsClient {
	public static final QName SERVICE_NAME = new QName("http://server.cxf.blkbox.com/", "IService");
	public static final QName PORT_NAME = new QName("http://server.cxf.blkbox.com/", "IServicePort");

	public static void main(String[] args) {
		System.out.println("client start");

		Service service = Service.create(SERVICE_NAME);

		String endpointAddress = "http://localhost:9000/Hello";
		service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, endpointAddress);
		IService iService = service.getPort(IService.class);
		System.out.println(iService.getWord("OK2"));

	}
}
